module.exports = function debounce(fn, interval) {
    var timer;
    var gapTime = interval || 1000; //间隔时间，如果interval不传，则默认1000ms
    return function (...args) {
        clearTimeout(timer);
        var context = this;
        timer = setTimeout(function () {
            fn.call(context, ...args);
        }, gapTime);
    };
}